package com.iknow.db;

import android.database.Cursor;
import android.provider.BaseColumns;
import com.iknow.IKnow;
import com.iknow.data.QingBo;
import com.iknow.data.QingboType;
import java.util.Date;

public class SubscribeQingboTable
  implements BaseColumns
{
  public static final String AUTHOR_ID = "jid";
  public static final String AUTHOR_NAME = "user_name";
  public static final String COMMENT_COUNT = "comment_count";
  public static final String CREATE_TABLE = "create table subscribe_qingbo (id text not null, date integer, title text not null, subject text, hot integer, favorite_count integer, comment_count integer, type text not null,thumbnail_url text,jid text not null,user_name text,tag text not null,page_type text not null,subscribe_flag integer)";
  public static final String DATE = "date";
  public static final String FAVORITE_COUNT = "favorite_count";
  public static final String HOT = "hot";
  public static final String PAGE_TYPE = "page_type";
  public static final String QINGBO_ID = "id";
  public static final String QINGBO_TAG = "tag";
  public static final String QINGBO_TYPE = "type";
  public static final String SUBJECT = "subject";
  public static final String SUBSCRIBE_FLAG = "subscribe_flag";
  public static final String[] TABLE_COLUMNS;
  public static final String TABLE_NAME = "subscribe_qingbo";
  public static final String TAG = "SubscribeQingboTable";
  public static final String THUMBNAIL_URL = "thumbnail_url";
  public static final String TITLE = "title";
  public static final int TYPE_FAVORITE = 4;
  public static final int TYPE_FLAG = 3;
  public static final int TYPE_FOLLOW = 1;
  public static final int TYPE_NEW = 2;

  static
  {
    String[] arrayOfString = new String[13];
    arrayOfString[0] = "id";
    arrayOfString[1] = "date";
    arrayOfString[2] = "subject";
    arrayOfString[3] = "title";
    arrayOfString[4] = "hot";
    arrayOfString[5] = "favorite_count";
    arrayOfString[6] = "comment_count";
    arrayOfString[7] = "type";
    arrayOfString[8] = "thumbnail_url";
    arrayOfString[9] = "jid";
    arrayOfString[10] = "user_name";
    arrayOfString[11] = "tag";
    arrayOfString[12] = "page_type";
    TABLE_COLUMNS = arrayOfString;
  }

  public static QingBo parseQingbo(Cursor paramCursor)
  {
    Object localObject;
    if ((paramCursor != null) && (paramCursor.getCount() == 0))
      localObject = null;
    while (true)
    {
      return localObject;
      QingBo localQingBo = new QingBo(paramCursor.getString(paramCursor.getColumnIndex("id")), paramCursor.getString(paramCursor.getColumnIndex("title")), paramCursor.getString(paramCursor.getColumnIndex("subject")), new Date(paramCursor.getLong(paramCursor.getColumnIndex("date"))), paramCursor.getString(paramCursor.getColumnIndex("thumbnail_url")), paramCursor.getString(paramCursor.getColumnIndex("user_name")), paramCursor.getString(paramCursor.getColumnIndex("jid")));
      localQingBo.setCommentCount(paramCursor.getString(paramCursor.getColumnIndex("comment_count")));
      localQingBo.setfavoriteCount(paramCursor.getString(paramCursor.getColumnIndex("favorite_count")));
      localQingBo.setHot(paramCursor.getString(paramCursor.getColumnIndex("hot")));
      localQingBo.setQingboType(QingboType.formString(paramCursor.getString(paramCursor.getColumnIndex("type"))));
      localQingBo.setAuthorAvatar(IKnow.mIKnowDataBase.getFriendAvatarUrl(localQingBo.getAuthorID() + "@" + "imiknow.com"));
      localQingBo.setTag(paramCursor.getString(paramCursor.getColumnIndex("tag")));
      localObject = localQingBo;
    }
  }
}